#include "MaFicheClient.h"

MaFicheClient::MaFicheClient(const QString &nom, const QString &ip)
{
    this->nom = nom;
    this->labelNom.setParent(this);
    this->labelNom.setText("<strong>" + nom + "</strong>");
    this->labelIp.setParent(this);
    this->labelIp.setText(ip);
    monBoutonPushKick = new MonBoutonPush("kicker", this);
    connect(monBoutonPushKick, SIGNAL(clicked()), this, SLOT(kickerClient()));
    layoutFicheClient = new QVBoxLayout(this);
    layoutFicheClient->addWidget(&(this->labelNom));
    layoutFicheClient->addWidget(&(this->labelIp));
    layoutFicheClient->addWidget(monBoutonPushKick);
    setLayout(layoutFicheClient);

    setWindowFlags(Qt::Widget);
}

MaFicheClient::~MaFicheClient()
{
}

QString MaFicheClient::getNom()
{
    return nom;
}

QString MaFicheClient::getIp()
{
    return labelIp.text();
}

void MaFicheClient::kickerClient()
{
    emit sig_kicker(nom);
}
